import request from '@/utils/request'
import { getToken } from '@/utils/auth'

/**
 *接口1 登录页面
 * @param {*} data {username password}
 * @returns promise
 */
export function loginApi(data) {
  return request({
    method: 'post',
    url: '/login',
    data
  })
}

/**
 *接口2:请求用户数据列表
 * @param {*} params {pagenum,pagesize}
 */
export function userinfolistApi(params) {
  return request({
    method: 'get',
    url: '/users',
    params,
    headers: {
      Authorization: getToken()
    }
  })
}

